package yxy.apple.util;

import java.util.Arrays;

public class ArraryMesh {

    public static int[] getNum(int[] originally, int[] addition, long round, int maxRound) {
        if (maxRound != -1) {
            round = round > maxRound ? maxRound : round;
        }
        int[] num = new int[originally.length];
        int index = 0;

        for (int i : originally) {
            for (int j : addition) {
                num[index] = i + (int) (i * j * round / 1000);
                addition = Arrays.copyOfRange(addition, 1, addition.length);
                index = index + 1;
                break;
            }
        }
        return num;
    }


    public static void main(String[] args) {
        int[] a = {10, 20, 30, 40, 50, 60, 70, 80, 90};
        int[] b = {200, 200, 200, 200, 200, 200, 200, 200, 200};

        int[] num = getNum(a, b, 7, 6);

        System.out.println(Arrays.toString(num));


    }

}
